<template>
    <el-col :span="3" class="aside-menu" :class="mainIsShow?'main-display-none':'main-display-block'" >
        <el-menu default-active="2" class="el-menu-vertical" @open="handleOpen" @close="handleClose" router>
            <el-submenu index="1">
                <template slot="title">基础管理</template>
                <el-menu-item index="/admin/basic/user/list">管理员管理</el-menu-item>
            </el-submenu>
            <el-submenu index="2">
                <template slot="title">图书管理</template>
                <el-menu-item index="/admin/book/book-type/list">图书分类管理</el-menu-item>
                <el-menu-item index="/admin/book/book-info/list">图书信息管理</el-menu-item>
                <el-menu-item index="/admin/book/book/list">图书管理</el-menu-item>
                <el-menu-item index="/admin/book/book-borrowing/list">图书借阅申请</el-menu-item>
                <el-menu-item index="/admin/book/book-borrow-confirm/list">图书借阅确认</el-menu-item>
                <el-menu-item index="/admin/book/book-return/list">图书归还管理</el-menu-item>
                <el-menu-item index="/admin/book/book-use-record/list">图书使用记录</el-menu-item>
                <el-menu-item index="/admin/book/book-comment/list">图书评论管理</el-menu-item>
            </el-submenu>
            <el-submenu index="3">
                <template slot="title">读者管理</template>
                <el-menu-item index="/admin/reader/reader-info/list">读者信息管理</el-menu-item>
            </el-submenu>
            <el-submenu index="4">
                <template slot="title">社区管理</template>
                <el-menu-item index="/admin/community/notice/list">公告管理</el-menu-item>
                <el-menu-item index="/admin/community/community-info/list">主题管理</el-menu-item>
                <el-menu-item index="/admin/community/community-post/list">帖子管理</el-menu-item>
                <el-menu-item index="/admin/community/community-post-return/list">回帖管理</el-menu-item>
            </el-submenu>
        </el-menu>
    </el-col>
</template>

<script>

    export default {
        props: ['mainIsShow'],
        data() {
            return {}
        },
        created:function(){
            //this.$router.push('/admin/core/dashboard'); // 页面加载时跳转
        },
        methods: {
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            },
        }
    }
</script>

<style>
    .main-display-block {
        display: block;
    }
    .main-display-none {
        display: none;
    }
    .el-menu-vertical {
        background-color: #eef1f6;
    }
   .aside-menu {
        flex: 0 0 230px;
        height: calc(100vh - 60px);
    }
    .el-menu-vertical{
        height: 100%;
    }
    .el-submenu .el-menu-item {
       /* background-color: #ecf5ff;*/
    }

</style>
